import service from '@/utils/request.js'

// 获取员工列表（简版信息）
export const getEmployees = _ => service.get('/sys/user/simple')

// 获取员工列表（详细信息）
export const getEmployeeList = ({ page, size }) => service.get('/sys/user', { params: { page, size }})

// 删除员工
export const deleteEmployee = id => service.delete(`/sys/user/${id}`)

// 新增员工
export const addEmployee = data => service.post('/sys/user', data)

// 导入表格
export const importEmployee = data => service.post('/sys/user/batch', data)

// 分配员工权限
export function assignRoles(data) {
  return service({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
